package cn.hct.springboot_pro.service.impl;

import cn.hct.springboot_pro.dao.OrderMapper;
import cn.hct.springboot_pro.entity.Orders;
import cn.hct.springboot_pro.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;


@Repository
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrderMapper orderDao;

    @Override
    public int addOrder(int item_id, int user_id,String item_name, int order_price,String consignee, String addr, String contact_way, String creat_time) {
        return orderDao.addOrder(item_id,user_id,item_name,order_price,consignee,addr,contact_way,creat_time);
    }

    @Override
    public Orders getOrderById(int order_id) {
        return orderDao.getOrderById(order_id);
    }

    @Override
    public Orders getOrderByTimeAndItem(int item_id, String creat_time) {
        return orderDao.getOrderByTimeAndItem(item_id,creat_time);
    }

    @Override
    public List<Orders> getOrderByUId(int user_id) {
        return orderDao.getOrderByUId(user_id);
    }

    @Override
    public List<Orders> getOrder() {
        return orderDao.getOrder();
    }

    @Override
    public int deleteOrderById(int order_id) {
        return orderDao.deleteOrderById(order_id);
    }

    @Override
    public Orders getOrderByItem(int item_id) {
        return orderDao.getOrderByItem(item_id);
    }


}
